package com.patrol.logisticsmanage.net;

import com.patrol.logisticsmanage.ui.appear.model.CompleteInputInfo;
import com.patrol.logisticsmanage.ui.appear.model.EvaluateInputInfo;
import com.patrol.logisticsmanage.ui.appear.model.SubCamp;
import com.patrol.logisticsmanage.ui.appear.model.SubmitInfo;
import com.patrol.logisticsmanage.ui.canteen.bean.CanteenListInfo;
import com.patrol.logisticsmanage.ui.canteen.bean.PayWay;
import com.patrol.logisticsmanage.ui.canteen.bean.RequestFoodListBean;
import com.patrol.logisticsmanage.ui.equip.StudentInfo;
import com.patrol.logisticsmanage.ui.login.LoginInfo;
import com.patrol.logisticsmanage.ui.orders.OrderDetail;
import com.patrol.logisticsmanage.ui.orders.OrderInfo;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.Query;
import rx.Observable;

/** 请求方法类
 */
public interface ApiServise {
    //https://api.apiopen.top/musicDetails?id=604392760  接口完整路径
    /**
     * get请求方式
     * @Query
     * 形成单个查询参数, 将接口url中追加类似于"page=1"的字符串,形成提交给服务器端的参数,
     * 主要用于Get请求数据，用于拼接在拼接在url路径后面的查询参数，一个@Query相当于拼接一个参数
     *
     * http://118.190.140.198:9081/jeecg-boot/stXst/hqStXst/list?_t=1590909886&column=createTime&order=desc&field=id,,,picture,name,introduction,principal,mobile,action&pageNo=1&pageSize=10
     */
    String HOST = "http://houqin.aeu.edu.cn:9080/jeecg-boot/";        //接口地址
//    String HOST = "http://192.168.2.101:9080/jeecg-boot/";        //接口地址


//    @GET("/musicDetails")
//    Observable<BaseReponse<List<MeiZiResponse>>> getMeiZi(@Query("id") String id);

    /**
     * post请求方式
     */
    @POST("sys/login")   //方法名
    Observable<BaseReponse<Map>> login(@Body LoginInfo loginInfo);

    @POST("cas/client/applogin")   //方法名
    Observable<BaseReponse<Map>> applogin(@Query("username")String username,@Query("password") String password,@Query("serviceurl") String serviceurl);

    @GET("stChuangK/hqStChuangk/list")
    Observable<BaseReponse<Map>> getList(@Query("shitId")String shitId);


    @GET("stCaip/hqStCaip/getCatalogAndCaiPData")
    Observable<BaseReponse<List<RequestFoodListBean>>> getFoodList(@Query("chuangk_id")String chuangk_id);

    @GET("sys/dict/getDictItems/ying_qu")
    Observable<BaseReponse<List>> getSubCampList();

    @GET("stSt/hqStSt/list")
    Observable<BaseReponse<Map>> getCanteenList(@Query("yingqId")String yingqId);

    //获取支付方式
    @GET("sys/dict/getDictItems/pay_way")
    Observable<BaseReponse<List<PayWay>>> getPayWayList();


    @POST("stOrder/htStOrder/add4App")   //下单
    Observable<BaseReponse<Map>> order(@Body OrderPayInfo orderPayInfo);

    @GET("stSt/hqStSt/selectAll")//一次获取所有食堂
    Observable<BaseReponse<List<CanteenListInfo>>> getAllCanteenList();

    @POST("bzBaseinfo/hqBzBaseinfo/add")//新建学员信息
    Observable<BaseReponse<Map>> addStudentInfo(@Body StudentInfo studentInfo);

    @GET("bzBaseinfo/hqBzBaseinfo/queryByLoginName")//获取被装资料信息
    Observable<BaseReponse<StudentInfo>> getStuInfo();

    @GET("sys/dict/getDictItems/card_type")//获取证件类型
    Observable<BaseReponse<List<SubCamp>>> getCardType();

    @GET("sys/duplicate/check")//身份证校验
    Observable<BaseReponse<Map>> checkCard(@Query("tableName")String tableName,@Query("fieldName")String fieldName,@Query("fieldVal")String fieldVal);

    @GET("louy/hqLouy/list")//获取楼宇信息
    Observable<BaseReponse<Map>> getSubCampFloorList(@Query("yingqId")String yingqId);

    @GET("yfRepair/hqYfRepair/mytodolist")//维修人员待办列表
    Observable<BaseReponse<Map>> getMyTodoList();

    @Multipart
    @POST("sys/common/upload")
    Observable<BaseReponse<Map>> upload( @Part MultipartBody.Part file);

    @POST("yfRepair/hqYfRepair/add")//上传报修
    Observable<BaseReponse<Map>> submit(@Body SubmitInfo submitInfo);

    @POST("yfRepair/hqYfRepair/kehuPingJia")//评价
    Observable<BaseReponse<Map>> evaluate(@Body EvaluateInputInfo evaluateInputInfo);

    @POST("yfRepair/hqYfRepair/finishRepair")//完成维修
    Observable<BaseReponse<Map>> complete(@Body CompleteInputInfo completeInputInfo);

    @GET("sys/dict/getDictItems/diaocwj")
    Observable<BaseReponse<List<SubCamp>>> getUrl();

    @GET("appurl/getUrl")
    Observable<BaseReponse<Map>> appUrl(@Query("userId")String userId);

    @GET("stWsjy/hqStWsjy/list")
    Observable<BaseReponse<Map>> getNotice();

    @GET("yfRepair/hqYfRepair/mydonelist")//wode 已办
    Observable<BaseReponse<Map>> getMyDoneList();

    @PUT("yfRepair/hqYfRepair/edit")//编辑耗材
    Observable<BaseReponse<Map>> editArmature(@Body TodoInfo todoInfo);


    @GET("yfRepair/hqYfRepair/myapplylist")//我的报修
    Observable<BaseReponse<Map>> myapplylist();

    @GET("stCaip/hqStCaip/yuangxfjl") //菜品消费记录
    Observable<BaseReponse<List<OrderInfo>>> yuangxfjl(@Query("userName")String userName, @Query("start")String start, @Query("end")String end);

    @GET("stCaip/hqStCaip/xiaofjlxq") //菜品
    Call<BaseReponse<List<OrderDetail>>> xiaofjlxq(@Query("dingdh")String dingdh);

    @GET("stCaip/hqStCaip/queryShitdqrs") //就餐人数
    Observable<BaseReponse<String>> queryShitdqrs(@Query("shitId")String shitId);

    @GET("stCaip/hqStCaip/cpdata")
    Observable<BaseReponse<List<OrderDetail>>> cpdata();
}

